#ifndef SCENE_H
#define SCENE_H

#include <QWidget>
#include "camera.h"
QT_BEGIN_NAMESPACE
namespace Ui { class Scene; }
QT_END_NAMESPACE

class Scene : public QWidget
{
    Q_OBJECT

public:
    Scene(QWidget *parent = nullptr);
    ~Scene();

private slots:
    void on_pushButton_clicked();

private:    
    void paintEvent(QPaintEvent *) override;
    void resizeEvent(QResizeEvent *event) override;
    void keyPressEvent(QKeyEvent *event) override;

    void mousePressEvent(QMouseEvent *event) override;
    void mouseMoveEvent(QMouseEvent *event) override;
    void mouseReleaseEvent(QMouseEvent *event) override;
    void wheelEvent(QWheelEvent *event) override;

    void initTimer();
private:
    Camera camera;

    bool _mousepressed = false;
    QPoint _oldpos;
    QPoint _oldmousepos;

    QTimer* _timer_update = nullptr;
    QTimer* _timer_wheel = nullptr;
    int _d_wheel = 0;
    Ui::Scene *ui;
};
#endif // SCENE_H
